package com.xmall.define.request.es;

import com.xmall.define.base.BasePageQueryRequest;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class EsSpuSearchRequest extends BasePageQueryRequest implements Serializable {

    /**
     * spuId
     */
    private Long spuId;

    /**
     * es版本
     */
    private Integer esVersion;

    /**
     * 分类ID
     */
    private Long categoryId;

    /**
     * 标题
     */
    private String skuTitle;

    /**
     * 最低价格
     */
    private BigDecimal startPrice = BigDecimal.ZERO;

    /**
     * 最高价格
     */
    private BigDecimal endPrice = BigDecimal.valueOf(Long.MAX_VALUE);

    /**
     * 排序
     */
    @Valid
    private List<EsSort> sorts = new ArrayList<>();

    /**
     * 属性
     */
    @Valid
    private List<EsAttr> attrs = new ArrayList<>();

    /**
     * 是否有库存
     */
    private Boolean hasStock;

    public EsSpuSearchRequest(Integer page, Integer pageSize) {
        super(page, pageSize);
    }
}
